

//
//  BaseTableViewController.swift
//  swiftWeiBoDemo
//
//  Created by zzw on 16/3/15.
//  Copyright © 2016年 zzw. All rights reserved.
//

import UIKit

class BaseTableViewController: UITableViewController ,VisitorViewDelegate{

    var login = false
    var visitorView:VisitorView?
    
    override func loadView() {
        login ? super.loadView() : setupVisitorView()
    }
    //MARK
    /**
     创建未登录界面
     */
    private func setupVisitorView(){
    
        let custumView = VisitorView()
        view = custumView
        custumView.delegate = self
        visitorView = custumView
        
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "注册", style: UIBarButtonItemStyle.Plain, target: self, action: "registerBtnWillClick")
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "登录", style: UIBarButtonItemStyle.Plain, target: self, action: "loginBtnWillClick")
        
        
    
    }
    
    func loginBtnWillClick() {
        print(__FUNCTION__)
    }
    func registerBtnWillClick() {
        print(__FUNCTION__)
    }
}
